/*
 * @lc app=leetcode.cn id=35 lang=cpp
 *
 * [35] 搜索插入位置
 */

// @lc code=start
class Solution {
public:
    int searchInsert(vector<int>& nums, int target) {
        int i = 0;
        while(nums[i] < target) {
            i++;
            if(i == nums.size()){
                break;
            }
        }
        return i;
    }
};
// @lc code=end

